<template>
  <div>
    <el-tabs v-model="editableTabsValue" @tab-click="handleClick">
      <el-tab-pane label="原生手动" name="1">
        <el-form ref="elForm1" :model="formData1" :rules="rules1" size="medium" label-width="100px">
          <el-form-item label="下单方向" prop="field105">
            <el-radio-group v-model="formData1.field105" size="medium">
              <el-radio-button v-for="(item, index) in field105Options" :key="index" :label="item.value"
                :disabled="item.disabled">{{item.label}}</el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="下单价格" prop="mobile">
            <el-input v-model="formData1.mobile" placeholder="请输入下单价格" :maxlength="11" show-word-limit
              clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
          </el-form-item>
          <el-form-item label="下单数量" prop="field101">
            <el-input v-model="formData1.field101" placeholder="请输入下单数量" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
          <el-form-item label="下单比例" prop="field102" required>
            <el-slider :max='100' :step='1' v-model="formData1.field102"></el-slider>
          </el-form-item>
          <el-form-item size="large">
            <el-button type="primary" @click="submitFormelForm1">提交</el-button>
            <el-button @click="resetFormelForm1">重置</el-button>
          </el-form-item>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="三角形下单" name="2">
        <el-form ref="elForm2" :model="formData2" :rules="rules2" size="medium" label-width="100px">
          <el-form-item label="下单方向" prop="field106">
            <el-radio-group v-model="formData2.field106" size="medium">
              <el-radio-button v-for="(item, index) in field106Options" :key="index" :label="item.value"
                :disabled="item.disabled">{{item.label}}</el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="价格范围" prop="field107">
            <el-radio-group v-model="formData2.log" size="medium">
              <el-radio-button v-for="(item, index) in field107Options" :key="index" :label="item.value"
                :disabled="item.disabled">{{item.label}}</el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="起始价格" prop="mobile">
            <el-input v-model="formData2.mobile" placeholder="请输入起始价格" :maxlength="11" show-word-limit
              clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
          </el-form-item>
          <el-form-item label="结束价格" prop="field108">
            <el-input v-model="formData2.field108" placeholder="请输入结束价格" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
          <el-form-item size="large">
            <el-button type="primary" @click="submitFormelForm2">提交</el-button>
            <el-button @click="resetFormelForm2">重置</el-button>
          </el-form-item>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="宝塔下单" name="3">
        <el-form ref="elForm3" :model="formData3" :rules="rules3" size="medium" label-width="100px">
          <el-form-item label="下单反响" prop="field112">
            <el-radio-group v-model="formData3.field112" size="medium">
              <el-radio-button v-for="(item, index) in field112Options" :key="index" :label="item.value"
                :disabled="item.disabled">{{item.label}}</el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="宝塔层级" prop="mobile">
            <el-input v-model="formData3.mobile" placeholder="请输入宝塔层级" :maxlength="11" show-word-limit
              clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
          </el-form-item>
          <el-form-item label="下单数量" prop="field109">
            <el-select v-model="formData3.field109" placeholder="请选择下单数量" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in field109Options" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item size="large">
            <el-button type="primary" @click="submitFormelForm3">提交</el-button>
            <el-button @click="resetFormelForm3">重置</el-button>
          </el-form-item>
        </el-form>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
  import baseUrl from '@/api/utils/baseConfig';
export default {
  components: {},
  props: {
    platform: null,
    runningId: null,
  },
  data() {
    return {
      editableTabsValue: '1',
      formData1: {
        field105: 1,
        mobile: '',
        field101: undefined,
        field102: 0,
      },
      rules1: {
        field105: [{
          required: true,
          message: '下单方向不能为空',
          trigger: 'change'
        }],
        mobile: [{
          required: true,
          message: '请输入下单价格',
          trigger: 'blur'
        }, {
          pattern: /^1(3|4|5|7|8|9)\d{9}$/,
          message: '手机号格式错误',
          trigger: 'blur'
        }],
        field101: [{
          required: true,
          message: '请输入下单数量',
          trigger: 'blur'
        }],
      },
      field105Options: [{
        "label": "下买单",
        "value": 1
      }, {
        "label": "下卖单",
        "value": 2
      }],
      formData2: {
        field106: 1,
        log: 1,
        mobile: '',
        field108: undefined,
      },
      rules2: {
        field106: [{
          required: true,
          message: '下单方向不能为空',
          trigger: 'change'
        }],
        log: [{
          required: true,
          message: '价格范围不能为空',
          trigger: 'change'
        }],
        mobile: [{
          required: true,
          message: '请输入起始价格',
          trigger: 'blur'
        }, {
          pattern: /^1(3|4|5|7|8|9)\d{9}$/,
          message: '手机号格式错误',
          trigger: 'blur'
        }],
        field108: [{
          required: true,
          message: '请输入结束价格',
          trigger: 'blur'
        }],
      },
      field106Options: [{
        "label": "下买单",
        "value": 1
      }, {
        "label": "下卖单",
        "value": 2
      }],
      field107Options: [{
        "label": "1%",
        "value": 1
      }, {
        "label": "2%",
        "value": 2
      }, {
        "label": "3%",
        "value": ""
      }, {
        "label": "4%",
        "value": ""
      }],
      formData3: {
        field112: 1,
        mobile: '',
        field109: undefined,
      },
      rules3: {
        field112: [{
          required: true,
          message: '下单反响不能为空',
          trigger: 'change'
        }],
        mobile: [{
          required: true,
          message: '请输入宝塔层级',
          trigger: 'blur'
        }, {
          pattern: /^1(3|4|5|7|8|9)\d{9}$/,
          message: '手机号格式错误',
          trigger: 'blur'
        }],
        field109: [{
          required: true,
          message: '请选择下单数量',
          trigger: 'change'
        }],
      },
      field112Options: [{
        "label": "下买单",
        "value": 1
      }, {
        "label": "下卖单",
        "value": 2
      }],
      field109Options: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitFormelForm1() {
      this.$refs['elForm1'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetFormelForm1() {
      this.$refs['elForm1'].resetFields()
    },
    submitFormelForm2() {
      this.$refs['elForm2'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetFormelForm2() {
      this.$refs['elForm2'].resetFields()
    },
    submitFormelForm3() {
      this.$refs['elForm3'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetFormelForm3() {
      this.$refs['elForm3'].resetFields()
    },
    handleClick(){

    }
  }
}

</script>
<style>
</style>
